<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../common/tagInclude.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
	<base href="${basePath}" />
	<title>消息内容列表</title>
	<META http-equiv="content-type" content="text/html; charset=UTF-8">
	<LINK href="${basePath}styleAdmin/css/portalinabox.css" type="text/css" rel="stylesheet">		
	<meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
   <meta http-equiv="expires" content="0">
	<script type="text/javascript" src="${basePath}styleAdmin/js/prototype-1.6.0.3.js"></script>
	<script type="text/javascript" src="${basePath}styleAdmin/js/Calendar/WdatePicker.js"></script>
	<script type="text/javascript" src="${basePath}styleAdmin/js/common.js"></script>
	<script type="text/javascript">
	function delSel(itemName){
		var all_checkbox = document.getElementsByName(itemName);
		var len = all_checkbox.length;
		if(isChecked(itemName) == false ){
			alert('至少选择一项');
		}else{
			if(!confirm('确认要删除指定消息?'))return;
			var values = "";
			for(var i=0;i<len ;i++){
				if(all_checkbox[i].checked)
					values += "," + all_checkbox[i].value;
			}
			if(values.length > 1)
				values = values.substring(1);
			window.location = '${basePath}admin/msgInfo/del.do?msgId='+values;
		}
	}
	function doQuery(){
		document.myform.submit();
	}
</script>
</HEAD>
<body bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">
<form action="${basePath}admin/msgInfo/list.do" method="post" name="myform">
<%@include file="../common/navigate.jsp" %>
<table width="96%" border="0" align="center" cellpadding="0" style="margin-top:5px;" cellspacing="0">
	<tr>
		<td valign="top">
			<!-- 搜索栏 -->
			<table width="100%" border="1" class="mainFunctionTable"  cellpadding="0" cellspacing="1">
				<tr height="25" class="pLabel">
			   		<td class="td_nwarpstyle">&nbsp;&nbsp;消息统计列表</td>
			 	</tr>
			 	<tr>
			   		<td width="100%" height="25">
			   			<table width="100%" border="0" cellspacing="1">
			     			<tr>
			       				<td align="left">
			       				消息来源&nbsp;<select name="msgFrom" id="msgFrom">
										<option value="0" <c:if test="${query.msgFrom == 0}">selected</c:if>>请选择</option>
										<c:forEach var="website" items="${websiteInfoList}">
											<option value="${website.id}" <c:if test="${query.msgFrom == website.id}">selected</c:if>>${website.name}</option>
										</c:forEach>				
									</select>&nbsp;&nbsp;
								消息目的&nbsp;<select name="msgTo" id="msgTo">
									<option value="0" <c:if test="${query.msgFrom == 0}">selected</c:if>>请选择</option>
									<c:forEach var="website" items="${websiteInfoList}">
										<option value="${website.id}"  <c:if test="${query.msgTo == website.id}">selected</c:if>>${website.name}</option>
									</c:forEach>				
								</select>&nbsp;&nbsp;
								同步状态&nbsp;<select name="msgStatus" id="msgStatus">
									<option value="0" <c:if test="${query.msgStatus ==  0}">selected</c:if>>请选择</option>
									<option value="1"  <c:if test="${query.msgStatus ==  1}">selected</c:if>>发送</option>
									<option value="2"  <c:if test="${query.msgStatus ==  2}">selected</c:if>>接收</option>
								</select>&nbsp;&nbsp;
								是否已读&nbsp;<select name="isRead" id="isRead">
									<option value="-1" <c:if test="${query.isRead ==  -1}">selected</c:if>>请选择</option>
									<option value="1"  <c:if test="${query.isRead ==  1}">selected</c:if>>已读</option>
									<option value="0"  <c:if test="${query.isRead ==  0}">selected</c:if>>未读</option>
								</select>&nbsp;&nbsp;
								是否已采用&nbsp;<select name="isUsed" id="isUsed">
									<option value="-1" <c:if test="${query.isUsed ==  -1}">selected</c:if>>请选择</option>
									<option value="1"  <c:if test="${query.isUsed ==  1}">selected</c:if>>已采用</option>
									<option value="0"  <c:if test="${query.isUsed ==  0}">selected</c:if>>未采用</option>
								</select>&nbsp;&nbsp;
								</td>
								<td align="right">
									<a href="javascript:doQuery();"><img src="${basePath}styleAdmin/images/button/query.gif" border="0"/></a>
			       				</td>
			     			</tr>
			    		</table>
			    	</td>
			   </tr>
			 </table>
		  </td>
	  </tr>
	  <tr>
	    <td>
	    	<a href="javascript:checkAll('msgId',true);">全选</a>&nbsp;&nbsp;<a href="javascript:checkAll('msgId',false);">取消</a>&nbsp;&nbsp;
			<a href="javascript:delSel('msgId');">删除所选</a>&nbsp;&nbsp;<br/>
			<table width=100% border=1 class="mainFunctionTable"  cellpadding="0" cellspacing="1" id="table_channel">
				<tr height=25 class="pLabel" align="center">
					<td width="5%" class="td_nwarpstyle">标识</td>
					<td class="td_nwarpstyle">消息标题</td>
					<td width="10%" class="td_nwarpstyle">来源</td>
					<td width="10%" class="td_nwarpstyle">目的</td>
					<td width="5%" class="td_nwarpstyle">同步状态</td>
					<td width="15%" class="td_nwarpstyle">同步时间</td>
					<td width="5%" class="td_nwarpstyle">是否已读</td>
					<td width="15%" class="td_nwarpstyle">已读时间</td>
					<td width="5%" class="td_nwarpstyle">是否采用</td>
					<td width="15%" class="td_nwarpstyle">采用时间</td>
				</tr>
			</table>
			<table width=100% border=1 class="mainFunctionTable"  cellpadding="0" cellspacing="1" id="table_channel">
					<c:forEach items="${msgInfoList}" var="msg" varStatus="status">
	   					<c:choose>
	   						<c:when test="${status.index % 2 == 0 }"><c:set var="css" value="c1" /></c:when>
	   						<c:otherwise><c:set var="css" value="c2" /></c:otherwise>
	   					</c:choose>
						<tr class="${css}" align="center">
							<td width="5%"><input type="checkbox" id="msgId" name="msgId" value="${msg.msgId}"/></td>
							<td><a href="${basePath}admin/msgInfo/msgInfoDetail.do?msgId=${msg.msgId}" title="点击查询消息详情">${msg.contentInfo.title}</a></td>
							<td width="10%">${msg.websiteFrom.name}</td>
							<td width="10%">${msg.websiteTo.name}</td>
							<td width="5%">
								<c:choose>
									<c:when test="${msg.msgStatus==1}">发送</c:when>
									<c:when test="${msg.msgStatus==2}">接收</c:when>
									<c:otherwise>未知</c:otherwise>
								</c:choose>
							</td>
							<td width="15%">${msg.statusTime}</td>
							<td width="5%">
								<c:choose>
									<c:when test="${msg.isRead==1}">已读</c:when>
									<c:otherwise>未读</c:otherwise>
								</c:choose>
							</td>
							<td width="15%"><c:if test="${msg.isRead==1}">${msg.readTime}</c:if></td>
							<td width="5%">
								<c:choose>
									<c:when test="${msg.isUsed==1}">已采用</c:when>
									<c:otherwise>未采用</c:otherwise>
								</c:choose>
							</td>
							<td width="15%"><c:if test="${msg.isUsed==1}">${msg.usedTime}</c:if></td>
						</tr>
					</c:forEach>
	  		</table>
		 </td>
	   </tr>
	   <tr>
		   <td height=25>
			<c:set var="pageURL" value="${basePath}admin/msgInfo/list.do?"/>
			<%@include file="../common/page.jsp"%>
		  </td>
	  </tr>
</table>
</form>
</body>
</HTML>